WIFI_WQ9001_SITE_METHOD = git
WIFI_WQ9001_SITE = https://github.com/gtxaspec/wq9001-wifi
WIFI_WQ9001_SITE_BRANCH = master
WIFI_WQ9001_VERSION = 3a625d7795e78b8c31b5b2e1d04369b5545b2fe1
# $(shell git ls-remote $(WIFI_WQ9001_SITE) $(WIFI_WQ9001_SITE_BRANCH) | head -1 | cut -f1)

WIFI_WQ9001_LICENSE = GPL-2.0
WIFI_WQ9001_LICENSE_FILES = COPYING

WIFI_WQ9001_MODULE_MAKE_OPTS = \
	KSRC=$(LINUX_DIR)

define WIFI_WQ9001_LINUX_CONFIG_FIXUPS
	$(call KCONFIG_ENABLE_OPT,CONFIG_WLAN)
	$(call KCONFIG_ENABLE_OPT,CONFIG_WIRELESS)
	$(call KCONFIG_ENABLE_OPT,CONFIG_WIRELESS_EXT)
	$(call KCONFIG_ENABLE_OPT,CONFIG_WEXT_CORE)
	$(call KCONFIG_ENABLE_OPT,CONFIG_WEXT_PROC)
	$(call KCONFIG_ENABLE_OPT,CONFIG_WEXT_PRIV)
	$(call KCONFIG_SET_OPT,CONFIG_CFG80211,y)
	$(call KCONFIG_SET_OPT,CONFIG_MAC80211,y)
	$(call KCONFIG_ENABLE_OPT,CONFIG_MAC80211_RC_MINSTREL)
	$(call KCONFIG_ENABLE_OPT,CONFIG_MAC80211_RC_MINSTREL_HT)
	$(call KCONFIG_ENABLE_OPT,CONFIG_MAC80211_RC_DEFAULT_MINSTREL)
	$(call KCONFIG_SET_OPT,CONFIG_MAC80211_RC_DEFAULT,"minstrel_ht")
endef

define WIFI_WQ9001_INSTALL_CALIBRATION_FILE
	$(INSTALL) -D -m 0644 $(@D)/cal/WQ9001_WiFi_Mapfile.dat \
		$(TARGET_DIR)/usr/share/wifi/WQ9001_WiFi_Mapfile.dat
endef

WIFI_WQ9001_POST_INSTALL_TARGET_HOOKS += WIFI_WQ9001_INSTALL_CALIBRATION_FILE

$(eval $(kernel-module))
$(eval $(generic-package))
